package com.javaee.cart;

import com.javaee.dao.CartDao;
import com.javaee.domain.Product;

import java.util.ArrayList;
import java.util.List;

public class ShoppingCart {
    private CartDao cartDao;
    private List<Product> items = new ArrayList<>();


    public void add(Product product) {
        cartDao.add(product);
    }

    public void remove(String id) {
        cartDao.remove(id);
    }

    public List<Product> listAll() {
        cartDao.listAll();
        return items;
    }
}